Optimal. Leaf size=111 \[ \frac {3 a b x}{4}+\frac {\left (a^2+b^2\right ) \sin (c+d x)}{d}+\frac {3 a b \cos (c+d x) \sin (c+d x)}{4 d}+\frac {a b \cos ^3(c+d x) \sin (c+d x)}{2 d}-\frac {\left (2 a^2+b^2\right ) \sin ^3(c+d x)}{3 d}+\frac {a^2 \sin ^5(c+d x)}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3873, 2715, 8,
4129, 3092, 380} \begin {gather*} -\frac {\left (2 a^2+b^2\right ) \sin ^3(c+d x)}{3 d}+\frac {\left (a^2+b^2\right ) \sin (c+d x)}{d}+\frac {a^2 \sin ^5(c+d x)}{5 d}+\frac {a b \sin (c+d x) \cos ^3(c+d x)}{2 d}+\frac {3 a b \sin (c+d x) \cos (c+d x)}{4 d}+\frac {3 a b x}{4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 380
Rule 2715
Rule 3092
Rule 3873
Rule 4129
Rubi steps
\begin {align*} \int \cos ^5(c+d x) (a+b \sec (c+d x))^2 \, dx &=(2 a b) \int \cos ^4(c+d x) \, dx+\int \cos ^5(c+d x) \left (a^2+b^2 \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a b \cos ^3(c+d x) \sin (c+d x)}{2 d}+\frac {1}{2} (3 a b) \int \cos ^2(c+d x) \, dx+\int \cos ^3(c+d x) \left (b^2+a^2 \cos ^2(c+d x)\right ) \, dx\\ &=\frac {3 a b \cos (c+d x) \sin (c+d x)}{4 d}+\frac {a b \cos ^3(c+d x) \sin (c+d x)}{2 d}+\frac {1}{4} (3 a b) \int 1 \, dx-\frac {\text {Subst}\left (\int \left (1-x^2\right ) \left (a^2+b^2-a^2 x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d}\\ &=\frac {3 a b x}{4}+\frac {3 a b \cos (c+d x) \sin (c+d x)}{4 d}+\frac {a b \cos ^3(c+d x) \sin (c+d x)}{2 d}-\frac {\text {Subst}\left (\int \left (a^2 \left (1+\frac {b^2}{a^2}\right )-\left (2 a^2+b^2\right ) x^2+a^2 x^4\right ) \, dx,x,-\sin (c+d x)\right )}{d}\\ &=\frac {3 a b x}{4}+\frac {\left (a^2+b^2\right ) \sin (c+d x)}{d}+\frac {3 a b \cos (c+d x) \sin (c+d x)}{4 d}+\frac {a b \cos ^3(c+d x) \sin (c+d x)}{2 d}-\frac {\left (2 a^2+b^2\right ) \sin ^3(c+d x)}{3 d}+\frac {a^2 \sin ^5(c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.29, size = 97, normalized size = 0.87 \begin {gather*} \frac {30 \left (5 a^2+8 b^2\right ) \sin (c+d x)-80 b^2 \sin ^3(c+d x)+a (120 b \sin (2 (c+d x))+25 a \sin (3 (c+d x))+3 (60 b (c+d x)+5 b \sin (4 (c+d x))+a \sin (5 (c+d x))))}{240 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 95, normalized size = 0.86
method | result | size |
derivativedivides | \(\frac {\frac {a^{2} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+2 b a \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {b^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) | \(95\) |
default | \(\frac {\frac {a^{2} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+2 b a \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {b^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) | \(95\) |
risch | \(\frac {3 a b x}{4}+\frac {5 a^{2} \sin \left (d x +c \right )}{8 d}+\frac {3 \sin \left (d x +c \right ) b^{2}}{4 d}+\frac {a^{2} \sin \left (5 d x +5 c \right )}{80 d}+\frac {b a \sin \left (4 d x +4 c \right )}{16 d}+\frac {5 a^{2} \sin \left (3 d x +3 c \right )}{48 d}+\frac {\sin \left (3 d x +3 c \right ) b^{2}}{12 d}+\frac {b a \sin \left (2 d x +2 c \right )}{2 d}\) | \(118\) |
norman | \(\frac {-\frac {3 a b x}{4}-\frac {\left (4 a^{2}-9 b a +20 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {\left (4 a^{2}-5 b a +4 b^{2}\right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {\left (4 a^{2}+5 b a +4 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d}+\frac {\left (4 a^{2}+9 b a +20 b^{2}\right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}-\frac {\left (76 a^{2}-15 b a +20 b^{2}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}+\frac {\left (76 a^{2}+15 b a +20 b^{2}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}-3 a b x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {15 a b x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {15 a b x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+3 a b x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {3 a b x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) | \(302\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 94, normalized size = 0.85 \begin {gather*} \frac {16 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} a^{2} + 15 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a b - 80 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} b^{2}}{240 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.93, size = 86, normalized size = 0.77 \begin {gather*} \frac {45 \, a b d x + {\left (12 \, a^{2} \cos \left (d x + c\right )^{4} + 30 \, a b \cos \left (d x + c\right )^{3} + 45 \, a b \cos \left (d x + c\right ) + 4 \, {\left (4 \, a^{2} + 5 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 32 \, a^{2} + 40 \, b^{2}\right )} \sin \left (d x + c\right )}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cos ^{5}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 247 vs.
\(2 (101) = 202\).
time = 0.48, size = 247, normalized size = 2.23 \begin {gather*} \frac {45 \, {\left (d x + c\right )} a b + \frac {2 \, {\left (60 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 75 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 60 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 80 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 30 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 160 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 232 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 200 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 80 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 30 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 160 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 60 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 75 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 60 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{5}}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.89, size = 117, normalized size = 1.05 \begin {gather*} \frac {5\,a^2\,\sin \left (c+d\,x\right )}{8\,d}+\frac {3\,b^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {3\,a\,b\,x}{4}+\frac {5\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{48\,d}+\frac {a^2\,\sin \left (5\,c+5\,d\,x\right )}{80\,d}+\frac {b^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2\,d}+\frac {a\,b\,\sin \left (4\,c+4\,d\,x\right )}{16\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________